<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
require_once APPLICATION_PATH.'/misc/additional.php';
class Application_Controllers_Transaction_confirmAction
{
    public $errorMessage="";

    public function preAction($form){
        return true;
    }
    public function onAction($form){
        $transaction = new Application_Model_DbTable_Transaction();
        $payment = new Application_Model_DbTable_Payment();
        $transaction_id=$form->getValue('transaction_id');
        $bank=$form->getValue('bank');
        $akun=$form->getValue('akun');
        $bukti=$form->getValue('bukti');
        $timeStamp = mktime(date('H'),date('i'), date('s')
                            ,date('m'),date('d'),date('y'));
        $dob_disp1=strftime('%Y-%m-%d %H:%M:%S',$timeStamp);
        $payment->insert(array('transaction_id'=>$transaction_id,'bank'=>$bank,
                         'akun'=>$akun,'gambar'=>$bukti));
        $transaction->update(array('payment_date'=>$dob_disp1,
                             'transaction_status_id'=>2),
                        'transaction_id='.(int)$transaction_id);
    }
}
?>
